<template>
  <div class="home">
    <div class="header">
      <div><b>性别:</b><p class="sex"><el-button type='text'>BOYS</el-button><el-button type='text'>GIRLS</el-button></p></div>
      <div><b>人群：</b><p class="people"><el-button type='text'>成人</el-button><el-button type='text'>大童11-15岁</el-button><el-button type='text'>中童7-10岁</el-button><el-button type='text'>小童2-6岁</el-button></p></div>
      <div><b>价格：</b><p class="price"><el-button type='text'>￥0-369</el-button><el-button type='text'>￥360-499</el-button><el-button type='text'>￥500-719</el-button><el-button type='text'>￥719以上</el-button></p></div>
      <div><b>颜色：</b><p class="color"><el-button type='text'>红色</el-button><el-button type='text'>橙色</el-button><el-button type='text'>金色</el-button><el-button type='text'>白色</el-button></p></div>
    </div>
    <div class="block">
      <div class="pagehead">
        <span>共{{list.length}}条</span>
        <el-button>上一页</el-button><span>第{{pageIndex}}页</span>
        <el-button>下一页</el-button>
      </div>
        <div class="wrap">
          <dl v-for="(v,i) in list" :key='i'>
            <dt><img :src="v.img" alt=""></dt>
            <dd></dd>
          </dl>
        </div>
    </div>
  </div>
</template>

<script>

import axios from "axios"
export default {
  name: 'Home',
  data(){
    return{
      list:[],
      pageIndex:1,
      pageSize:4
    }
  },
  methods:{
    getList(){
      axios.post('/api/list',({pageIndex:this.pageIndex,PageSize:this.pageSize})).then(resp=>{
        console.log(resp.data.data)
        this.list=resp.data.data
      })
    }
  },
  created(){
    this.getList()
  }
}
</script>
<style lang="scss" scoped>
  .home{
    width: 100%;
    height: auto;
  }
  .header{
    width: 100%;
    padding: 10px 20px;
    div{
      display: flex;
      align-items: center;
      border-bottom: 1px solid #ccc;
      justify-content: start;
      button{
        margin-left: 30px;
      }
    }
  }
  .block{
    width: 100%;
    .pagehead{
      width: 100%;
      height: 60px;
      justify-content: end;
      align-items: center;
      display: flex;
      button{
        margin: 0 15px;
      }
    }
    .wrap{
      width: 100%;
      display: flex;
      justify-content: space-around;
    }
  }
</style>
